import {request} from "../utils/request"

export const Test = ()=>{
	return request({
		url:"/run-mini/test"
	})
}
// 分页查询
export const getRunList = (data:any)=>{
	return request({
		url:"/run-mini/getRunList",
		method:"POST",
		data:data
	})
}
//发布订单
export const pubRun = (data:any)=>{
	return request({
		url:"/run-mini/pubRun",
		method:"POST",
		data:data
	})
}
//根据订单id获取跑腿帖子信息
export const getRunById = (id:any)=>{
	return request({
		url:"/run-mini/getRunById",
		method:"GET",
		data:{id:id}
	})
}
//接单
export const acceptRun = (runNumber: any, userId: any) => {
  // 手动拼接参数到URL
  return request({
    url: `/run-mini/acceptRun?runNumber=${runNumber}&userId=${userId}`,
    method: "GET"
    // 无需再写 params 或 data
  });
};

export const updateState = (id:any) => {
  // 手动拼接参数到URL
  return request({
    url: "/run-mini/updateState",
    method: "GET",
	data:{id:id}
    // 无需再写 params 或 data
  });
};
export const getShopOrder = (runNumber:any) => {
  // 手动拼接参数到URL
  return request({
    url: "/run-mini/getShopOrder",
    method: "GET",
	data:{runNumber:runNumber}
    // 无需再写 params 或 data
  });
};